﻿#include "SafeZoneInfo.h"
#include "../../Shared/Functions/Functions.h"

namespace Server::MirDatabase
{

    SafeZoneInfo::SafeZoneInfo()
    {

    }

    SafeZoneInfo::SafeZoneInfo(BinaryReader *reader)
    {
        Location = new Point(reader->ReadInt32(), reader->ReadInt32());
        Size = reader->ReadUInt16();
        StartPoint = reader->ReadBoolean();
    }

    void SafeZoneInfo::Save(BinaryWriter *writer)
    {
        writer->Write(Location->X);
        writer->Write(Location->Y);
        writer->Write(Size);
        writer->Write(StartPoint);
    }

    std::string SafeZoneInfo::ToString()
    {
        return StringHelper::formatSimple("Map: {0}- {1}", Functions::PointToString(Location), StartPoint);
    }
}
